package com.example.rwq_test.designParttern.multiThread.activeObject;

/**
 * TODO note
 *
 * @author renweiqiang
 * @version 1.0.0
 * @createTime 2022/12/20
 */
public class MakeStringRequest extends MethodRequest<String> {
    private final int count;
    private final char fillChar;

    protected MakeStringRequest(Servant servant, FutureResult<String> future, int count, char fillChar) {
        super(servant, future);
        this.count = count;
        this.fillChar = fillChar;
    }

    @Override
    public void execute() {
        Result<String> result = servant.makeString(count, fillChar);
        future.setResult(result);
    }
}
